<?php
/** 
 * $Source: /cvsroot/pn-commerce/pn-commerce/pntemplates/plugins/function.pncItemsPerPageSelector.php,v $
 * $Author: landseer $
 * $Revision: 1.4 $
 * $Date: 2004/07/09 13:22:33 $
 *
 * Type: Function
 *
 * creates a complete dropdown where the user can select the number
 * of items to be displayed per page 
 * @param: SIchecked - array with items per page steps
 * @param: ItemsPerPage - current selection
 * @return string 
 */
function smarty_function_pncItemsPerPageSelector($params, &$smarty)
{
    extract($params);

    pnModLoad('pncommerce','user');
    pnModAPILoad('pncommerce','user');

    $SIchecked[$ItemsPerPage] = "selected";
    return "<form action='".pnModAPIFunc('pncommerce', 'user', 'pncModURL', array( 'Module' => 'pncommerce', 'Section' => 'user', 'Function' => 'categoryview' ) )."' method='post'>
           <span class='pn-normal'>".pnVarPrepForDisplay(_PNC_ITEMSPERPAGE)."
           <select class='pn-text' name='ipp'>
           <option value='ALL' $SIchecked[0]> ".pnVarPrepForDisplay(_PNC_ALL)." </option>
           <option value=5 $SIchecked[5]> 5 </option>
           <option value=10 $SIchecked[10]> 10 </option>
           <option value=25 $SIchecked[25]> 25 </option>
           <option value=50 $SIchecked[50]> 50 </option>
           <option value=75 $SIchecked[75]> 75 </option>
           <option value=100 $SIchecked[100]> 100 </option>
           <option value=200 $SIchecked[200]> 200 </option>
           </select>
           <input class='pn-button' type='submit' name='Submit' value='".pnVarPrepForDisplay(_PNC_SUBMIT)."'>
           </span>
           </form>";
}
?>
